<template>
	<!-- #ifdef H5 -->
		<view>
			<iframe id="mapPage" width="100%" height="800upx" frameborder=0
				src="https://apis.map.qq.com/tools/locpicker?search=1&type=1&key=BFLBZ-ZG6C5-R3FIB-Q3IMS-BEZA2-7OFS6&referer=myapp">
			</iframe>
		</view>
	<!-- #endif -->
</template>

<script>
	// #ifdef H5
		window.addEventListener('message', function(event) {
			// 接收位置信息，用户选择确认位置点后选点组件会触发该事件，回传用户的位置信息
			var loc = event.data;
			
			console.log(event.data.poiname);
			var address = event.data.poiaddress
			uni.redirectTo({
				url: 'shopMsgAmend?poiname=' + address + '&type=2' + '&lat=' + event.data.latlng.lat + '&lng=' + event.data.latlng.lng
			})
			
			if (loc && loc.module == 'locationPicker') {
				//防止其他应用也会向该页面post信息，需判断module是否为'locationPicker'
				console.log('location', loc);
			}
		}, false);
		export default {
			data() {
				return {
					addList:'',
					type:'',
				}
			},
			onLoad(option) {
				this.type = parseInt(option.type, 10);
			},
			methods: {
				
			}
		}
	// #endif
</script>

<style>

</style>
